/*
 * @Description: 异步地打开目录进行迭代扫描。
 * @Author: dh
 * @Date: 2021-09-02 16:51:50
 * @LastEditors: dh
 * @LastEditTime: 2023-10-24 11:16:25
 */

const { opendir } = require('fs/promises')
const path = require('path')

;(async () => {
	try {
		const dir = await opendir(path.join(__dirname, '../'))
		for await (const dirent of dir) console.log(dirent.name)
	} catch (err) {
		console.error(err)
	}
})()
